package com.pu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pu.entity.AddressBook;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/**
 * @Author Yusc
 * @Date 2023/11/1 17:04
 * @Version
 * @Description C端地址薄管理
 **/
@Mapper
public interface AddressBookMapper extends BaseMapper<AddressBook> {
    /**
    * @auther: Yusc
    * @date 2023/11/1 17:35
    * @Description 设置所有用户的默认地址为0
    */
    @Update("update address_book set is_default = #{isDefault} where user_id = #{userId}")
    void updateIsDefaultByUserId(AddressBook addressBook);
}
